#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author : hai.long
import random
from faker import Faker
from utils.common import gen_code_to_str
from utils.static_data import static_data_dict


class MyFaker(Faker):

    def __init__(self):
        super().__init__(locale="zh-CN")

    # 随机生成农场名称
    def random_farm_name(self):
        return random.choice(static_data_dict["farm_names"])

    # 随机生成地块名称
    def random_land_name(self):
        return random.choice(static_data_dict["land_names"])

    # 随机生成作物名称
    def random_crop_name(self):
        return random.choice(static_data_dict["crop_names"])

    # 随机生成姓名
    def random_name(self):
        return self.name()

    # 随机生成一个手机号码
    def random_phone(self):
        return self.phone_number()

    # 随机生成身份证
    def random_ssn(self):
        return self.ssn()

    # 随机生成一个完整的公司名称
    def random_company(self):
        return self.company()

    # 随机生成一个地址
    def random_address(self):
        return self.address()


my_faker = MyFaker()

if __name__ == '__main__':
    get_line = 58
    now_line = 60
    for num in range(get_line, now_line):
        step_line = num + 1
        line = -9 - (now_line - num - 1)
        c_line, text = gen_code_to_str(step_line, line)
        print(step_line, text)
